package comunicacao;

import entities.Range;
import entities.ServerInfo;
import entities.Teatro;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import entities.Teatro;


/**
  * @author Leonardo Lino Nº45340
 * @author Diogo Pires Nº40351
 */
public interface ReceiveMessageInterface extends Remote

{
	// Metodo para saber teatros que existem
	public ArrayList<String> listTheaters() throws RemoteException;

	// metodo para pesquisar por um unico teatro
	public Teatro getTheater(String theaterName) throws RemoteException;

	// reserva de 1 lugar num teatro
	public boolean reserveSeat(String theaterName, int lugarID, int userID, String timestamp)
			throws RemoteException;
	
	 //remove a reserva de 1 lugar num teatro
    public boolean removeSeatReserve(String theaterName, int lugarID, int userID) throws RemoteException;

	// compra de 1 lugar num teatro
	public boolean purchaseSeat(String theaterName, int lugarID, int userID)
			throws RemoteException;

	// metodo para deitar abaixo o servidor
	public boolean falha() throws RemoteException;

	// metodo para recomeÃ§ar o servidor
	public boolean restart() throws RemoteException;
	
	//Carrega a base de dados a partir de outra base de dados indicada
	public void loadDatabase(ServerInfo provider, ServerInfo providerReplic, ServerInfo coordinator, Range mainRange, Range coordinatorRange, Range replicRange, int shardingLevel) throws RemoteException;
	
	public boolean removeTheater(String theaterName, boolean inReplic) throws RemoteException;
	
	public boolean writeTheater(Teatro teatro, boolean inReplic) throws RemoteException;
	
	public Teatro getTheaterInReplica(String theaterName) throws RemoteException;
	
	public void setNewRange(Range mainRange, Range coordinatorRange,Range replicRange) throws RemoteException;

}
